const http = require('http')

const opts = {
      host: 'http://sfnsdkfjdsnk.com',
      port: 80,
      path: '/'
}

const req = http.get(opts, res => {
    console.log('will this get called')
})

// http处理异常
req.on('error', err=>{
    console.log(err, 'error')
})